package com.zb.order.service;

import com.zb.entity.AccounLoginInfo;
import com.zb.entity.SelectAddressVo;
import com.zb.entity.ZjWorkOrder;
import com.zb.exception.SMSException;
import com.zb.exception.ZbException;
import com.zb.mobile.NetworkMobileEngineerSignVo;
import com.zb.result.PageUtil;
import com.zb.vo.*;

import java.util.List;
import java.util.Map;

/**
 * @Author WEN
 * @Date 2023/9/20 0020
 **/
public interface ConWorkOrderService {

    /**
     * 创建、修改工单
     *
     * @param loginInfo
     * @param isUserMobileOrder 是否客户报单移动端工单：false-不是，true-是
     * @param orderVo
     * @return
     */
    Map<String, Object> save(AccounLoginInfo loginInfo, boolean isUserMobileOrder, OrderVo orderVo);

    /**
     * 获取工单列表
     * @param loginInfo 商家ID
     * @param selectVo 搜索条件
     * @return
     */
    Map<String, Object> getList(AccounLoginInfo loginInfo, OrderListSelectVo selectVo);

    /**
     * 获取归档列表状态数量
     * @param custAccId 商家ID
     * @return
     */
    Map<String, Object> getOrderArchivedStatusQty(Long custAccId);

    /**
     * 获取工单归档列表
     * @param loginInfo 登录信息
     * @param searchVo 搜索条件
     * @return
     */
    Map<String, Object> getOrderArchivedList(AccounLoginInfo loginInfo, OrderArchivedListSearchVo searchVo);

    /**
     * 获取结算列表状态数量
     * @param custAccId 商家ID
     * @return
     */
    OrderSettlementStatusQtyVo getOrderSettlementStatusQty(Long custAccId);

    /**
     * 获取工单结算列表
     * @param loginInfo 登录账号
     * @param searchVo 搜索条件
     * @return
     */
    Map<String, Object> getOrderSettlementList(AccounLoginInfo loginInfo, OrderSettlementListSearchVo searchVo);

    /**
     * 根据工单ID获取工单详情
     * @param id 工单ID
     * @return
     */
    OrderDetailVo getOrderDetail(Long id);

    /**
     * 根据工单ID获取工单商品
     * @param workId 工单ID
     * @return
     */
    Map<String, Object> getOrderGoodsDetail(Long workId, PageUtil pageUtil);


    /**
     * 根据工单ID获取工单商品
     * @param workId 工单ID
     * @return
     */
    List<AfterSaleProductVo> getOrderGoodsDetail(Long workId);

    /**
     * 工单预约时间
     * @param loginInfo
     * @param orderReservationTimeVo
     */
    void reservationTime(AccounLoginInfo loginInfo, OrderReservationTimeVo orderReservationTimeVo);

    /**
     * 工单派单给服务商
     * @param loginInfo 登录信息
     * @param orderDispatchNetworkVo 派单信息
     */
    void orderDispatchNetwork(AccounLoginInfo loginInfo, OrderDispatchNetworkVo orderDispatchNetworkVo);

    /**
     * 改派服务商
     * @param loginInfo
     * @param changeNetworkVo
     */
    void changeNetwork(AccounLoginInfo loginInfo, OrderChangeNetworkVo changeNetworkVo);

    /**
     * 改派工单客服
     * @param loginInfo
     * @param changeServiceEmpVo
     */
    void changeServiceEmp(AccounLoginInfo loginInfo, OrderChangeServiceEmpVo changeServiceEmpVo);

    /**
     * 保存工单留言
     * @param loginInfo
     * @param orderLeaveMessageVo
     */
    void saveWorkLeaveMessage(AccounLoginInfo loginInfo, OrderLeaveMessageVo orderLeaveMessageVo);

    /**
     * 保存服务商的工单留言
     * @param loginInfo
     * @param orderLeaveMessageVo
     */
    void saveNetworkWorkLeaveMessage(AccounLoginInfo loginInfo, OrderLeaveMessageVo orderLeaveMessageVo);

    /**
     * 根据工单ID获取客服工单留言
     * @param workId 工单ID
     * @param pageUtil
     */
    Map<String, Object> getWorkLeaveMessageList(Long workId, PageUtil pageUtil);

    /**
     * 根据工单ID获取服务商地址
     * @param workId 工单ID
     * @return
     */
    SelectAddressVo getOrderNetworkAddress(Long workId);

    /**
     * 工单归档
     * @param loginInfo 登录账号
     * @param archivedVo 归档工单信息
     */
    void orderArchived(AccounLoginInfo loginInfo, OrderArchivedVo archivedVo);

    /**
     * 获取工单详情的工单费用
     * @param workId
     * @return
     */
    Object getOrderTotalFee(Long workId);

    /**
     * 根据工单ID获取是否开启签到
     * @param workId 工单ID
     * @return
     */
    Object getNetworkEmpIsEnableSign(Long workId);

    /**
     * 根据工单ID获取工程师签到设置
     * @param workId 工单ID
     * @return
     */
    Object getNetworkEmpMobileSignSet(Long workId);

    /**
     * 根据工单ID获取结单核销码
     * @param workId 工单ID
     * @return
     */
    void getStatementWriteOffCode(AccounLoginInfo loginInfo, Long workId) throws SMSException;

    /**
     * 获取核销码
     * @param workId 工单ID
     * @param moduleId 模块ID
     * @param userPhone 客户手机号
     * @return
     */
    String getStatementWriteOffCode(Long workId, Long moduleId, String userPhone);

    /**
     * 根据工单ID获取待审核改派服务商的工单
     * @param workId 工单ID
     * @return
     */
    WorkWaitCheckReassignVo getWaitCheckWorkReassign(Long workId);

    /**
     * 审核改派服务商的工单
     * @param loginInfo
     * @param workId 工单ID
     * @param reassignVo
     */
    void checkWorkReassign(AccounLoginInfo loginInfo, Long workId, WorkCheckReassignVo reassignVo);

    /**
     * 根据工单ID获取工单待结单审核
     * @param workId 工单ID
     * @return
     */
    WorkWaitCheckFinishOrderVo getWaitCheckStatementOrder(Long workId);

    /**
     * 审核结单
     * @param loginInfo
     * @param workId 工单ID
     * @param checkStatementVo
     */
    void checkStatementOrder(AccounLoginInfo loginInfo, Long workId, WorkCheckStatementVo checkStatementVo);

    /**
     * 允许驳回未结单的工单
     * @param loginInfo
     * @param workId 工单ID
     */
    void backStatementOrder(AccounLoginInfo loginInfo, Long workId);
    /**
     * 根据工单ID获取待审核取消工单
     * @param workId 工单ID
     * @return
     */
    WorkCancelWaitCheckVo getWaitCheckCancelOrder(Long workId);

    /**
     * 审核取消工单
     * @param loginInfo
     * @param workId 工单ID
     * @param checkCancelVo
     */
    void checkCancelOrder(AccounLoginInfo loginInfo, Long workId, WorkCheckCancelVo checkCancelVo);

    /**
     * 获取待审核的工单事件
     * @param workId 工单ID
     * @return
     */
    List<WorkWaitCheckOrderEvent> getWaitCheckOrderEvent(Long workId);

    /**
     * 保存工单催单
     * @param loginInfo
     * @param reminderVo
     */
    void saveReminder(AccounLoginInfo loginInfo, OrderReminderVo reminderVo) throws ZbException;

    /**
     * 工单超时提醒
     * @param loginInfo
     * @param workTimeoutRemindVo
     */
    WorkTimeoutRemindResultVo workTimeoutRemind(AccounLoginInfo loginInfo, WorkTimeoutRemindVo workTimeoutRemindVo) throws ZbException;

    /**
     * 批量更新工单流程为完成
     * @param loginInfo
     * @param orderEventVo
     */
    void finishOrder(AccounLoginInfo loginInfo, OrderEventVo orderEventVo);

    /**
     * 批量更新工单流程为取消
     * @param loginInfo
     * @param orderEventVo
     */
    void cancelOrder(AccounLoginInfo loginInfo, OrderEventVo orderEventVo);

    /**
     * 更改结算价
     * @param loginInfo
     * @param workSettlementPriceVo
     */
    void updateSettlementPrice(AccounLoginInfo loginInfo, WorkSettlementPriceVo workSettlementPriceVo);

    /**
     * 根据工单ID获取结单字段
     * @param workId 工单ID
     * @return
     */
    List<WorkFinishOrderTemplateVo> getOrderSettlementField(Long workId);

    /**
     * 根据工单ID工单明细打印
     * @param id 工单ID
     * @return
     */
    WorkOrderDetailsPrintedVo getWorkOrderDetailsPrinted(Long id);

    /**
     *  指定旧工单复制一份新工单
     */
    OrderVo copySave(AccounLoginInfo loginInfo, boolean isUserMobileOrder, Long orderId);

    void workAgain(ZjWorkOrder zjWorkOrder);

    void signImage(ZjWorkOrder zjWorkOrder);

    /**
     * 客服核实时间
     */
    void saveVerifiedVisitTime(AccounLoginInfo loginInfo, OrderVerifyVisitTimeVo verifyVisitTimeVo);
}
